IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[spDriver_DeleteDriver]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spDriver_DeleteDriver]
GO

GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eric Liew
-- Create date: 6/2/2009
-- Description:	Delete Driver
-- =============================================
CREATE PROCEDURE [dbo].[spDriver_DeleteDriver]
(
	@DriverID			int
 )
AS
BEGIN

	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;


	UPDATE Driver 
	SET Active = 0 
	WHERE DriverID = @DriverID
	
	DELETE DriverRate
	WHERE DriverRate.DriverId = @DriverID
	
	Delete DriverComment
	Where DriverComment.DriverId = @DriverID
 

END
GO
